<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        var name = "    itbaizhan    ";
        var result = name.trim();
        console.log(name);
        console.log(result);

        var name2 = "\r\nitbaizhan \t";
        console.log(name2.trim());
        //老师，如果字符串中间有空格，能不能去掉？？
        //去不掉
        var name3 = "it    bai   zhan";
        console.log(name3);
        console.log(name3.trim());

        var name4 = "    itbaizhan    ";
        console.log(name4.trimStart());
        console.log(name4.trimEnd());
        
        
        

    </script>
</body>
</html>